package com.gym.system.statistics.service.impl;

import java.util.List;
import java.util.stream.Collectors;

import com.gym.system.goods.domain.GymGoods;
import com.gym.system.goods.mapper.GymGoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gym.system.statistics.mapper.GymGoodsStatisticsMapper;
import com.gym.system.statistics.domain.GymGoodsStatistics;
import com.gym.system.statistics.service.IGymGoodsStatisticsService;
import com.gym.common.core.text.Convert;

/**
 * 统计Service业务层处理
 *
 * @author administrator
 * @date 2021-04-11
 */
@Service
public class GymGoodsStatisticsServiceImpl implements IGymGoodsStatisticsService {
    @Autowired
    private GymGoodsStatisticsMapper gymGoodsStatisticsMapper;
    @Autowired
    private GymGoodsMapper gymGoodsMapper;

    /**
     * 查询统计
     *
     * @param id 统计ID
     * @return 统计
     */
    @Override
    public GymGoodsStatistics selectGymGoodsStatisticsById(Long id) {
        return gymGoodsStatisticsMapper.selectGymGoodsStatisticsById(id);
    }

    /**
     * 查询统计列表
     *
     * @param gymGoodsStatistics 统计
     * @return 统计
     */
    @Override
    public List<GymGoodsStatistics> selectGymGoodsStatisticsList(GymGoodsStatistics gymGoodsStatistics) {
        List<GymGoodsStatistics> gymGoods = gymGoodsStatisticsMapper.selectStatistics();
        return gymGoods;
    }

    /**
     * 新增统计
     *
     * @param gymGoodsStatistics 统计
     * @return 结果
     */
    @Override
    public int insertGymGoodsStatistics(GymGoodsStatistics gymGoodsStatistics) {
        return gymGoodsStatisticsMapper.insertGymGoodsStatistics(gymGoodsStatistics);
    }

    /**
     * 修改统计
     *
     * @param gymGoodsStatistics 统计
     * @return 结果
     */
    @Override
    public int updateGymGoodsStatistics(GymGoodsStatistics gymGoodsStatistics) {
        return gymGoodsStatisticsMapper.updateGymGoodsStatistics(gymGoodsStatistics);
    }

    /**
     * 删除统计对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteGymGoodsStatisticsByIds(String ids) {
        return gymGoodsStatisticsMapper.deleteGymGoodsStatisticsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除统计信息
     *
     * @param id 统计ID
     * @return 结果
     */
    @Override
    public int deleteGymGoodsStatisticsById(Long id) {
        return gymGoodsStatisticsMapper.deleteGymGoodsStatisticsById(id);
    }
}
